public class Client {
    public static void main(String[] args) {
        Receiver receiver = new Receiver();
        ConcreteCommandOn commandOn = new ConcreteCommandOn(receiver);
        ConcreteCommandOff commandOff = new ConcreteCommandOff(receiver);
        Invoker invoker = new Invoker();

        invoker.setCommand(commandOn);
        invoker.executeCommand();

        invoker.setCommand(commandOff);
        invoker.executeCommand();
    }
}